home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1999 June
/
Macworld (1999-06).dmg
/
Shareware World
/
Info
/
For Developers
/
MacZoop2.0.sea
/
MacZoop2.0
/
Required Classes
/
ZCommander.h
< prev
next >
Wrap
Text File
|
1999-02-11
|
3KB
|
110 lines
/*************************************************************************************************
*
*
* MacZoop - "the framework for the rest of us"
*
*
*
* ZCommander.h -- an object for handling commands
*
*
*
*
*
* © 1996, Graham Cox
*
*
*
*
*************************************************************************************************/
#pragma once
#ifndef __ZCOMMANDER__
#define __ZCOMMANDER__
#ifndef __ZCOMRADE__
#include "ZComrade.h"
#endif
#ifndef __ZOBJECTARRAY__
#include "ZObjectArray.h"
#endif
#include <balloons.h>
class ZCommander;
class ZDialog;
// set up streaming stuff:
DEFINECLASSID( ZCommander, 'zcmd' );
typedef ZObjectList ZCommanderList;
// class def:
class ZCommander : public ZComrade
{
protected:
ZCommander* itsBoss;
ZCommanderList* itsUnderlings;
public:
ZCommander( ZCommander* aBoss );
ZCommander();
virtual ~ZCommander();
virtual void HandleCommand( const short menuID, const short itemID);
virtual void HandleCommand( const long theCommand );
virtual void UpdateMenus();
virtual void HandleAppleEvent( AEEventClass aeClass, AEEventID aeID,
AppleEvent* aeEvt, AppleEvent* reply );
virtual void Idle();
virtual void Type( const char theKey, const short modifiers );
virtual void SendMessage( long aMessage, void* msgData );
virtual void SendMessage( ZMessage* aMessage );
virtual void DoTimer( long timerID ) {};
virtual void DoSuspend();
virtual void DoResume();
virtual Boolean GetBalloonHelp( const Point mouseIn,
Rect* rectOut,
Point* tipOut,
HMMessageRecord* hmOut ) { return FALSE; };
virtual void DoCut() { DoCopy(); DoClear(); };
virtual void DoCopy() {};
virtual void DoPaste() {};
virtual void DoClear() {};
virtual void DoSelectAll() {};
virtual Boolean CanPasteType() { return FALSE; };
virtual ZDialog* OpenSubDialog( const short dlogID );
virtual void ContextualMenuClick( Point globalMouse ) {};
virtual ZCommander* GetHandler() { return this; };
inline ZCommander* GetBoss(){ return itsBoss; };
inline ZCommanderList* GetUnderlings() { return itsUnderlings; };
// streaming:
virtual void WriteToStream( ZStream* aStream );
virtual void ReadFromStream( ZStream* aStream );
protected:
virtual void AddUnderling( ZCommander* anUnderling );
virtual void RemoveUnderling( ZCommander* anUnderling );
};
// windows and the application are derived from this. It implements a single entity in the
// "chain of command". You can subclass this to make any object that can handle commands,
// though more usually you will subclass windows.
#endif